Docker Hands on: Deploy, Administer Docker Platform by Navin Sabharwal & Bibin W

Docker Hands on: Deploy, Administer Docker Platform by Navin Sabharwal & Bibin W

Author:Navin Sabharwal & Bibin W [Sabharwal, Navin]
Language: eng
Format: azw3, epub
Published: 2015-01-06T00:00:00+00:00


mkdir wordpress && cd wordpress

Create a Dockerfile and copy the following snippet on to the file.

FROM ubuntu:latest

MAINTAINER Bibin Wilson <[email protected]>

RUN apt-get update

RUN apt-get -y upgrade

RUN apt-get -y install apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-ldap

RUN RUN apt-get -y install php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl

ENV APACHE_RUN_USER www-data

ENV APACHE_RUN_GROUP www-data

ENV APACHE_LOG_DIR /var/log/apache2

ENV APACHE_LOCK_DIR /var/lock/apache2

ENV APACHE_PID_FILE /var/run/apache2.pid

EXPOSE 80

ADD http://wordpress.org/latest.tar.gz /wordpress.tar.gz

RUN tar xvzf /wordpress.tar.gz

RUN rm -rf /var/www/

RUN mv /wordpress /var/www/

ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf

CMD /usr/sbin/apache2ctl -D FOREGROUND

The above Dockerfile does the following.

Updates the images

Installs required apache2 and php elements required for wordpress

Sets few environment variables for apache, which will be used by the apache conf file associated with the Docker file.

Exposes port 80 on container

Downloads the latest wordpress setup files and copies it to the desired folder.

Adds the apache config file from the host to container.

Starts apache server.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.